package com.qf.service.Impl;

import com.qf.dao.TbManagersMapper;
import com.qf.entitys.TbManagers;
import com.qf.service.TbManagersService;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import javax.annotation.Resource;

@Service
public class TbManagersServiceImpl implements TbManagersService {

    @Resource
    private TbManagersMapper mapper;

    @Override
    public int deleteByPrimaryKey(String mgrId) {
        return 0;
    }

    @Override
    public int insert(TbManagers record) {
        return 0;
    }

    @Override
    public int insertSelective(TbManagers record) {
        return 0;
    }

    @Override
    public TbManagers selectByPrimaryKey(String mgrId) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(TbManagers record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(TbManagers record) {
        return 0;
    }

    @Override
    public TbManagers selectByIdAndPwd(TbManagers record) {
        //将获取到的密码通过spring自带的加密工具进行加密
        record.setLoginPwd(DigestUtils.md5DigestAsHex(record.getLoginPwd().getBytes()));
        return mapper.selectByIdAndPwd(record);
    }
}
